package com.bawei.module_home.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

/**
 * @Author : yaotianxue
 * @Time : On 2023/5/27 09:24
 * @Description : HomeFragmentPageAdapter
 */

class HomeFragmentPageAdapter(val list:List<Fragment>,val fm:FragmentManager,var behavior:Int ):FragmentPagerAdapter(fm,behavior) {
    private var titles = arrayOf("发现","推荐","日报")
    override fun getCount(): Int {
        return list.size
    }

    override fun getItem(position: Int): Fragment {
       return list[position]
    }
    //返回对应的标题
    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position]
    }
}